// 接口模块管理
import request from '@/utils/request';
//引入SKU相关类型
import type { SkuResponseData, SkuInfoData } from './type';
// 枚举地址
enum API {
    // 获取已有的商品数据
    SKU_URL = '/admin/product/list/',
    // 上架商品
    SALE_URL = '/admin/product/onSale/',
    // 下架商品
    UNSALE_URL = '/admin/product/cancelSale/',
    //获取商品详情
    SKUINFO_URL = '/admin/product/getSkuInfo/',
    //删除商品的接口
    DELETESKU_URL = '/admin/product/deleteSku/'
}

//获取商品SKU的接口
export const reqSkuList = (limit: number, page: number) => request.get<any, SkuResponseData>(API.SKU_URL + page + '/' + limit)
//上架商品的接口
export const reqSale = (skuId: number | string) => request.get<any, any>(API.SALE_URL + skuId)
//下架商品的接口
export const reqCancelSale = (skuId: number | string) => request.get<any, any>(API.UNSALE_URL + skuId)
//获取商品详情的接口
export const reqSkuInfo = (skuId: number) => request.get<any, SkuInfoData>(API.SKUINFO_URL + skuId)
//删除已有的商品
export const reqDelete = (skuId: number) => request.delete<any, any>(API.DELETESKU_URL + skuId)
//